package org.example.admin.service.impl;

import org.example.admin.exception.BizException;
import org.example.admin.mapper.NotifyViewRecordMapper;
import org.example.admin.service.NotifyViewRecordService;
import org.example.entity.NotifyViewRecord;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class NotifyViewRecordServiceImpl implements NotifyViewRecordService {
    private NotifyViewRecordMapper notifyViewRecordMapper;

    NotifyViewRecordServiceImpl(NotifyViewRecordMapper notifyViewRecordMapper) {
        this.notifyViewRecordMapper = notifyViewRecordMapper;
    }

    //插入查看消息列表的字段
    @Override
    public void insert(NotifyViewRecord notifyViewRecord)throws BizException {
        try {
            System.out.println("nvr的具体消息："+notifyViewRecord);
            notifyViewRecordMapper.insert(notifyViewRecord);
//            Integer.parseInt("ab");
        }catch (Exception ex) {
            ex.printStackTrace();
            throw new BizException("业务层插入异常: " + ex.getMessage());
        }
    }
}
